name = input("请输入要查询的姓名：")
found = False

with open("data.txt", "r", encoding="gbk") as f:
    for line in f:
        line = line.strip()
        if not line:
            continue
        n, dept, score = line.split()
        if n == name:
            print(f"系名：{dept}，分数：{score}")
            found = True
            break

if not found:
    print("未找到该学生")